package com.ssy.lingxi.after.sale.repository;

import com.ssy.lingxi.after.sale.entity.ReplaceGoodsDetailAssociatedDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 *  换货物料
 * @author ds
 * @version 2.0.0
 * @date 2021/4/30 9:59
 */
public interface ReplaceGoodsDetailMaterielRepository extends JpaRepository<ReplaceGoodsDetailAssociatedDO, Long>, JpaSpecificationExecutor<ReplaceGoodsDetailAssociatedDO> {

    /**
     * 根据换货id删除换货物料
     * @author 伍将
     * @date 2020/9/11
     * @param replaceId:
     * @return void
     **/
    void deleteAllByReplaceId(Long replaceId);

    /**
     * 根据退货id查询所有换货物料
     * @author ds
     * @date 2020/4/30
     * @param replaceId:
     * @return List<ReturnGoodsDetailMaterielDO>
     **/
    List<ReplaceGoodsDetailAssociatedDO> findByReplaceId(Long replaceId);
    /**
     * 根据退货id查询所有换货物料
     * @author ds
     * @date 2020/4/30
     * @param replaceDetailIds:
     * @return List<ReturnGoodsDetailMaterielDO>
     **/
    List<ReplaceGoodsDetailAssociatedDO> findAllByReplaceDetailIdIn(List<Long> replaceDetailIds);
}
